<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCouponTypeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('coupon_type', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->comment('礼品名称');
            $table->string('description')->default('')->comment('礼品卡描述');
            $table->string('pic')->comment('礼品卡图片');
            $table->unsignedInteger('total')->comment('库存数量');
            $table->unsignedInteger('used')->default(0)->comment('使用数量');
            $table->timestamps();
        });

        \DB::statement("ALTER TABLE `coupon_type` comment '优惠券类型'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('coupon_type');
    }
}
